//
//  ZBHTTPService+Notice.m
//  BaseRACDemo
//
//  Created by 庄波 on 2018/3/9.
//  Copyright © 2018年 庄波. All rights reserved.
//

#import "ZBHTTPService+Notice.h"
#import "ZBOneNote.h"

@implementation ZBHTTPService (Notice)
/// 获取直播间列表
- (RACSignal *)fetchLivesWithUseridx:(NSString *)useridx size:(NSInteger)size page:(NSInteger)page {
    /// 1. 配置参数
    MHKeyedSubscript *subscript = [MHKeyedSubscript subscript];
    subscript[@"userId"] = useridx;
    subscript[@"pageSize"] = @(size);
    subscript[@"pageNum"] = @(page);

    /// 2. 配置参数模型 #define MH_GET_LIVE_ROOM_LIST  @"Room/GetHotLive_v2"
    MHURLParameters *paramters = [MHURLParameters urlParametersWithMethod:MH_HTTTP_METHOD_GET path:MH_GET_NOTE_LIST parameters:subscript.dictionary];
    
    /// 3.发起请求
    return [[[MHHTTPRequest requestWithParameters:paramters]
             enqueueResultClass:[ZBOneNote class]]
            mh_parsedResults];
    
    /** 复杂的方式
     /// 配置请求模型
     MHHTTPRequest *request = [MHHTTPRequest requestWithParameters:paramters];
     /// 发起请求
     return [[MHHTTPService sharedInstance] enqueueRequest:request resultClass:[MHLiveRoom class]];
     */
}
@end
